package org.jsrml.core.purchaser.qo;

import org.jsrml.common.persistence.BaseQO;
import org.jsrml.common.persistence.query.QueryCondition;
import org.jsrml.common.persistence.query.QueryConditionGroup;
import org.jsrml.common.persistence.query.QueryConditionType;
import org.jsrml.common.persistence.query.QueryConfig;

@SuppressWarnings("serial")
@QueryConfig(daoBeanId = "departmentService")
public class DepartmentQO extends BaseQO<String> {

	@QueryConditionGroup(value="group1")
	@QueryCondition(name = "departmentCode", type = QueryConditionType.LIKE_ANYWHERE)
	private String code;

	@QueryConditionGroup(value="group1")
	@QueryCondition(name = "departmentName", type = QueryConditionType.LIKE_ANYWHERE)
	private String name;

	@QueryCondition(name = "parentDept", type = QueryConditionType.FETCH_EAGER)
	private Boolean fetchParentDept;

	@QueryCondition(name = "childDept", type = QueryConditionType.FETCH_EAGER)
	private Boolean fetchChildDept = false;

	@QueryCondition(name = "parentDept", type = QueryConditionType.LEFT_JOIN)
	private DepartmentQO parentDeptQO;

	@QueryCondition(name = "company", type = QueryConditionType.FETCH_EAGER)
	private Boolean fetchCompany;

	@QueryCondition(name = "company", type = QueryConditionType.LEFT_JOIN)
	private CompanyQO companyQO;

	@QueryCondition(name = "status.remove")
	private Boolean remove;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getFetchParentDept() {
		return fetchParentDept;
	}

	public void setFetchParentDept(Boolean fetchParentDept) {
		this.fetchParentDept = fetchParentDept;
	}

	public Boolean getFetchChildDept() {
		return fetchChildDept;
	}

	public void setFetchChildDept(Boolean fetchChildDept) {
		this.fetchChildDept = fetchChildDept;
	}

	public DepartmentQO getParentDeptQO() {
		return parentDeptQO;
	}

	public void setParentDeptQO(DepartmentQO parentDeptQO) {
		this.parentDeptQO = parentDeptQO;
	}

	public Boolean getRemove() {
		return remove;
	}

	public void setRemove(Boolean remove) {
		this.remove = remove;
	}

	public Boolean getFetchCompany() {
		return fetchCompany;
	}

	public void setFetchCompany(Boolean fetchCompany) {
		this.fetchCompany = fetchCompany;
	}

	public CompanyQO getCompanyQO() {
		return companyQO;
	}

	public void setCompanyQO(CompanyQO companyQO) {
		this.companyQO = companyQO;
	}

}
